#include  <stdio.h>
#include  <stdlib.h>
#define MAXSIZE 100
typedef char datatype;
typedef struct seqstack{
   	datatype elem[MAXSIZE];
   	int top;
}seqstack;
 
 
void init(seqstack *s)
{
  	s->top=-1;
}


int empty(seqstack s)
{
 	return(s.top==-1? 1:0);
}


void push(seqstack *s,datatype x)
{
   	if(s->top==MAXSIZE-1)
     	{printf("\nThe sequence stack is full!");exit(1);}
   	s->top++;
   	s->elem[s->top]=x;
}


datatype pop(seqstack *s)
{
   	datatype x;
	if(s->top==-1)
     	{printf("\nThe sequence stack is empty!");exit(1);}
   	x=s->elem[s->top];
	s->top--;
	return x;
}
